<div id="ContentGroup">
    <div class="count-header">
        <a>用户信息添加</a>
    </div>
    <div class="count-content-group">
        <div class="count-content">
            <form id="YHXX_Insert" data-role="form" data-event="finish" data-type="post" data-url="<{'YHXX_Insert_Action'|U}>">
                <input type="hidden" id="YHXX_BH_ORA" name="YHXX_BH_ORA" value="<{$Model->YHXX_BH|security_encript}>"/>

                <div class="count-content-title">用户信息</div>
                <div class="count-content-type"><{*此处添加全局注释*}></div>
                <div class="form-list-item">
                    <label class="form-list-item-label">用户组信息</label>
                    <{$yhzxx= YHZXX::query()}>
                    <{'YHZXX_BH'|html_dropdownlist:$yhzxx.DataList:$Model->YHZXX_BH:'YHZXX_BH':'YHZXX_MC'}>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>姓名</label>
                    <input type="text" id="YHXX_XM" name="YHXX_XM" value="<{$Model->YHXX_XM }>"/>

                    <p class="form-list-item-tip">显示在界面上的用户名称，建议填写姓名</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>账号</label>
                    <input type="text" id="YHXX_ZH" name="YHXX_ZH" value="<{$Model->YHXX_ZH }>"/>

                    <p class="form-list-item-tip">用户登录系统时使用的账号</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>密码</label>
                    <input type="text" id="YHXX_MM" name="YHXX_MM" value="<{$Model->YHXX_MM }>"/>

                    <p class="form-list-item-tip">密码不允许为空</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label">邮箱</label>
                    <input type="text" id="YHXX_YX" name="YHXX_YX" value="<{$Model->YHXX_YX }>"/>

                    <p class="form-list-item-tip">请填写正确的邮箱，允许不填写</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label">联系电话</label>
                    <input type="text" id="YHXX_LXDH" name="YHXX_LXDH" value="<{$Model->YHXX_LXDH }>"/>

                    <p class="form-list-item-tip">建议填写常用电话，允许不填写</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>状态</label>
                    <{'YHXX_ZT'|html_dropdownlist:["启用" , "停用"]:$Model->YHXX_ZT}>
                    <p class="form-list-item-tip">处于停用状态的用户无法登录系统</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label">图片</label>
                    <input type="text" id="YHXX_TP" name="YHXX_TP" value="<{$Model->YHXX_TP }>"/>
                    <span id="YHXX_TPImage" class="button">选择图片</span>

                    <p class="form-list-item-tip">本地上传200*200的图片，或输入远程图片url</p>
                </div>
            </form>
            <div class="form-operation">
                <span class="button" id="YHXX_Insert-Submit">提交</span>
                <span class="button" data-role="back">返回</span>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#ContentGroup").formset(0);//开启页面标签页
        //$("#YHXX_Insert").vtip();//开启鼠标提示.
        //客户端验证脚本
        $("#YHXX_Insert").validate({
            rules: {
                "YHXX_BH": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHZXX_BH": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHXX_XM": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHXX_ZH": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHXX_MM": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHXX_YX": {
                    "maxbytelength": 50
                },
                "YHXX_LXDH": {
                    "maxbytelength": 50
                },
                "YHXX_ZT": {
                    "maxbytelength": 50,
                    "required": true
                },
                "YHXX_TP": {
                    "maxbytelength": 500
                },
                "example": {} //可继续追加jquery validate客户端验证条件
            },
            "errorClass": "form-list-item-warn",
            //errorPlacement: function (error, element) {element.attr("data-tips", error.text());},//关闭默认提示，使用鼠标提示框时使用
            submitHandler: function () {
                $("#YHXX_Insert").trigger("finish");
            }
        });

        $("#YHXX_TPImage").click(function(){
            $.imageUpload("YHXX_TP", 200, 200,$("#YHXX_TP").val(), function(data){
                $("#YHXX_TP").val(data);
            });
        });
        $("#YHXX_XM").attr("data-tip", "显示在界面上的用户名称，建议填写姓名");
        $("#YHXX_ZH").attr("data-tip", "用户登录系统时使用的账号");
        $("#YHXX_MM").attr("data-tip", "密码不允许为空");
        $("#YHXX_YX").attr("data-tip", "请填写正确的邮箱，允许不填写");
        $("#YHXX_LXDH").attr("data-tip", "建议填写常用电话，允许不填写");
        $("#YHXX_ZT").attr("data-tip", "处于停用状态的用户无法登录系统");
        $("#YHXX_Insert-Submit").click(function () {
            $("#YHXX_Insert").submit();
        });
    });
</script>
